﻿using UnityEngine;

namespace Watermelon
{
    [System.Serializable]
    public class CurrenciesSave : ISaveObject
    {
        [SerializeField] Currency.Save[] currenciesSaves;
        public Currency.Save[] CurrenciesSaves => currenciesSaves;

        public CurrenciesSave()
        {
            currenciesSaves = null;
        }

        public CurrenciesSave(Currency[] activeCurrencies)
        {
            currenciesSaves = new Currency.Save[activeCurrencies.Length];
            for(int i = 0; i < currenciesSaves.Length; i++)
            {
                currenciesSaves[i] = new Currency.Save(activeCurrencies[i].CurrencyType, activeCurrencies[i].Amount);
            }
        }
    }
}